<template>
  <div class="header">
    <div class="left-bar">
      <div class="title-box">
        <div class="title">
          <slot name="title">{{ title }}</slot>
        </div>
        <div class="content">
          <slot name="content">{{ content }}</slot>
        </div>
      </div>
      <slot name="option" />
    </div>

    <div class="right-bar">
      <slot />
    </div>
  </div>
</template>

<script>
export default {
  name: 'TableHeader',
  props: {
    title: {
      type: String,
      required: true
    },
    content: {
      type: String,
      default: ''
    }
  }
}
</script>

<style lang="scss" scoped>
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: #fff;
    .left-bar {
        display: flex;
        align-items: center;
        .title-box {
            .title {
                font-size: 20px;
            }
            .content {
                color: #909399;
                font-size: 14px;
                margin-top: 10px;
                &:empty {
                    display: none;
                }
            }
        }
    }
}
</style>
